home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / intrvews / xgrab.lha / xgrab / include / textedit.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-24  |  1.2 KB  |  56 lines

  1. /**
  2.    GRAB Graph Layout and Browser System
  3.  
  4.    Copyright (c) 1987, 1988, 1989 Stanford University
  5.    Copyright (c) 1989, Tera Computer Company
  6.  **/
  7.  
  8. #ifndef textedit_h
  9. #define textedit_h
  10.  
  11. #include "textviewer.h"
  12.  
  13. // Declare imported types.
  14.  
  15. class Graphic;
  16. class StringList;
  17.  
  18. // A TextEdit edits an array of lines of text.
  19.  
  20. class TextEdit : public TextViewer 
  21. {
  22. public:
  23.     TextEdit(StringList*, Graphic*);
  24.     void Handle(Event&);
  25.     StringList* GetText();
  26.     void SetText(StringList*);
  27. protected:
  28.     Painter* GraphicToPainter(Graphic*);
  29.     int NumCols(StringList*);
  30.     int NumLines(StringList*);
  31.     void HandleChar(char);
  32.     void begline();
  33.     void delline();
  34.     void delnextchar();
  35.     void delprevchar();
  36.     void delrest();
  37.     void endline();
  38.     void indent();
  39.     void newline();
  40.     void nextchar();
  41.     void nextline();
  42.     void openline();
  43.     void prevchar();
  44.     void prevline();
  45.     void tab();
  46.     void toggleow();
  47.     void unindent();
  48.  
  49.     Coord line;            // stores current row position
  50.     Coord column;        // stores current column position
  51.     Coord tline;        // stores separate row position when needed
  52.     Coord tcolumn;        // stores separate column position when needed
  53. };
  54.  
  55. #endif
  56.